<!--
 * @Descripttion: 
 * @version: 
 * @Author: wutao
 * @LastEditors: wutao
 * @LastEditTime: 2025-09-18 21:55:17
-->
<template>
  <div>
    <!-- <div class="top_hytitle" style="margin-top: 0;">
            <div class="letf_line"></div>
            <div class="center_text">欢迎回来</div>
            <div class="right_line"></div>
          </div> -->
    <div class="">
      <p style="margin: 15px 0; color: #9998a9">
        {{ formatTimestamp(topList.createTime) }}
      </p>

      <div class="top-box" :class="isShadow?'boxShadow':''">
        <!-- <p>{{ topList.title }}</p> -->
         <img src="../../assets/iconIndex/ztfx_logo.png" class="ztfx_logo" alt="">
        <div class="top-box-list" style="background: linear-gradient(180deg, rgba(8,131,241,0.028) 0%, rgba(8,131,241,0.012) 100%);border: 1px solid rgba(8,131,241,0.08);">
          <div
            v-for="(topItemCard, topItemIndex) in topList.card"
            class="top-box-list-item top-box-list-item-border"
            :key="topItemIndex"
            :style="{
              marginBottom:
                topItemIndex === topList.card.length - 1 ? '0px' : '15px',
              borderBottom:
                topItemIndex === topList.card.length - 1
                  ? 'none'
                  : 'none',
              paddingBottom:
                topItemIndex === topList.card.length - 1 ? '0' : '15px',
            }"
            @click="gotosldetails(topItemCard)"
          >
            <p>
              <strong class="xiahuaxian">{{ topItemCard.name.split("（")[0] }}{{
                topItemCard.name.split("（")[1]
                  ? "（" + topItemCard.name.split("（")[1]
                  : ""
              }}</strong
              >
              
              {{ "涨幅" }}
              <span v-if="topItemCard.up == 1" style="color: red">{{
                "+" + topItemCard.upData
              }}</span>
              <span v-else-if="topItemCard.up == 2" style="color: #999999">{{
                "-" + topItemCard.upData
              }}</span>
              <span v-else style="color: green">{{ topItemCard.upData }}</span>
            </p>
            <p class="ztfx-span">{{ topItemCard.sub }}</p>
          </div>
        </div>
        <div class="top-box-btn" @click="djrbseechance">
          {{ "查看详细涨停解析" }}
        </div>
        <p class="askMe">你可以尝试这样问我</p>
        <div
          @click="sendMessageBy(topItemLink)"
          v-for="(topItemLink, topItemLinkIndex) in topList.link"
          class="top-box-list-item-link"
          :key="topItemLinkIndex"
        >
          {{ topItemLink }}
        </div>
      </div>
    </div>
  </div>
</template>
  
  <script>
import {} from "@/utils/common";
import { Toast } from "vant";
import commonFunc from "@/utils/ysjh";
export default {
  data() {
    return {};
  },
  props: {
    topList: {
      type: Object,
      default: () => {},
    },isShadow: {
    type: Boolean,
    default: false,
  },
  },
  watch: {},
  mounted() {},
  created() {},
  methods: {
    sendMessageBy(e) {
      this.$parent.showCollect = false;
      this.$parent.someMethod(e);
    },
    //查看更多涨停解析
    djrbseechance() {
      let openSource = this.topList.url.openSource;
      let openType = this.topList.url.openType;
      let functionCode = this.topList.url.functionCode;
      let param = this.topList.url.param;
      commonFunc.openService(openSource, openType, functionCode, param);
      // const JumpUrl =
      //   "https://djyyztex.gyzq.com.cn:18080/hardenAnalyze/client/ztjx/index.html#/?GYIconColor=2&GYBackgroundColor=ffffff&GYOpacity=1";
      // commonFunc.openService("", "4", "KDS_WebPageNoHead", {
      //   webUrl: JumpUrl,
      //   loginType: "1",
      // });
    },

    formatTimestamp(ms) {
      if (!ms) {
        return "";
      }
      const time = Number(ms);
      if (!time || isNaN(time)) return "-";
      const d = new Date(time);
      const Y = d.getFullYear();
      const M = String(d.getMonth() + 1).padStart(2, "0");
      const D = String(d.getDate()).padStart(2, "0");
      const h = String(d.getHours()).padStart(2, "0");
      const m = String(d.getMinutes()).padStart(2, "0");
      const s = String(d.getSeconds()).padStart(2, "0");
      return `${Y}-${M}-${D} ${h}:${m}:${s}`;
    },
  },
};
</script>
  
 <style lang="less" scoped>
.ztfx-span {
  opacity: 1;
  color: #666666 !important;
  font-family: PingFang SC;
  font-weight: regular;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0px;
  text-align: justified;
  background: none !important;
  font-weight: normal !important;
}
.top-box-list-item-border {
  // border-bottom: 1px solid #aecde8;
}
.ztfx_logo{
  width: 209px;
  height: 23px;
}
.xiahuaxian {
  color: #333333;
  font-family: PingFang SC;
  font-weight: bold;
  font-size: 16px;
  display: inline;
  background-image: linear-gradient(to bottom, transparent 60%, #c1d8fc 40%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
</style>
  